<?php
namespace TagLib;

use Think\Template\TagLib;
class Text extends TagLib{
    protected $tags = array(
        'newif' => array('attr'=>'condition'),
    );
    
    public function _newif($tag,$content){
        $condition = $tag['condition'];
        
        $php_str = '<?php if(';
        $php_str .= $condition.'):';
        $php_str .= '?>';
        $php_str .= $content;
        $php_str .= '<?php endif;?>';
        
        return $php_str;
    }
}